\(\int \sec ^4(e+f x) (a+b (c \tan (e+f x))^n)^p \, dx\) [492]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F(-1)]
   Maxima [F]
   Giac [F(-2)]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 160 \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\frac {\operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b (c \tan (e+f x))^n}{a}\right ) \tan (e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}}{f}+\frac {\operatorname {Hypergeometric2F1}\left (\frac {3}{n},-p,\frac {3+n}{n},-\frac {b (c \tan (e+f x))^n}{a}\right ) \tan ^3(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}}{3 f} \]

[Out]

hypergeom([1/n, -p],[1+1/n],-b*(c*tan(f*x+e))^n/a)*tan(f*x+e)*(a+b*(c*tan(f*x+e))^n)^p/f/((1+b*(c*tan(f*x+e))^
n/a)^p)+1/3*hypergeom([-p, 3/n],[(3+n)/n],-b*(c*tan(f*x+e))^n/a)*tan(f*x+e)^3*(a+b*(c*tan(f*x+e))^n)^p/f/((1+b
*(c*tan(f*x+e))^n/a)^p)

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3756, 1907, 252, 251, 372, 371} \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\frac {\tan ^3(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (\frac {b (c \tan (e+f x))^n}{a}+1\right )^{-p} \operatorname {Hypergeometric2F1}\left (\frac {3}{n},-p,\frac {n+3}{n},-\frac {b (c \tan (e+f x))^n}{a}\right )}{3 f}+\frac {\tan (e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (\frac {b (c \tan (e+f x))^n}{a}+1\right )^{-p} \operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b (c \tan (e+f x))^n}{a}\right )}{f} \]

[In]

Int[Sec[e + f*x]^4*(a + b*(c*Tan[e + f*x])^n)^p,x]

[Out]

(Hypergeometric2F1[n^(-1), -p, 1 + n^(-1), -((b*(c*Tan[e + f*x])^n)/a)]*Tan[e + f*x]*(a + b*(c*Tan[e + f*x])^n
)^p)/(f*(1 + (b*(c*Tan[e + f*x])^n)/a)^p) + (Hypergeometric2F1[3/n, -p, (3 + n)/n, -((b*(c*Tan[e + f*x])^n)/a)
]*Tan[e + f*x]^3*(a + b*(c*Tan[e + f*x])^n)^p)/(3*f*(1 + (b*(c*Tan[e + f*x])^n)/a)^p)

Rule 251

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F1[-p, 1/n, 1/n + 1, (-b)*(x^n/a)],
x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p
] || GtQ[a, 0])

Rule 252

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^FracPart[p]/(1 + b*(x^n/a))^Fra
cPart[p]), Int[(1 + b*(x^n/a))^p, x], x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILt
Q[Simplify[1/n + p], 0] &&  !(IntegerQ[p] || GtQ[a, 0])

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 372

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^FracPart[p]/
(1 + b*(x^n/a))^FracPart[p]), Int[(c*x)^m*(1 + b*(x^n/a))^p, x], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[
p, 0] &&  !(ILtQ[p, 0] || GtQ[a, 0])

Rule 1907

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, n, p}, x] && (PolyQ[Pq, x] || PolyQ[Pq, x^n])

Rule 3756

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (c^2+x^2\right ) \left (a+b x^n\right )^p \, dx,x,c \tan (e+f x)\right )}{c^3 f} \\ & = \frac {\text {Subst}\left (\int \left (c^2 \left (a+b x^n\right )^p+x^2 \left (a+b x^n\right )^p\right ) \, dx,x,c \tan (e+f x)\right )}{c^3 f} \\ & = \frac {\text {Subst}\left (\int x^2 \left (a+b x^n\right )^p \, dx,x,c \tan (e+f x)\right )}{c^3 f}+\frac {\text {Subst}\left (\int \left (a+b x^n\right )^p \, dx,x,c \tan (e+f x)\right )}{c f} \\ & = \frac {\left (\left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}\right ) \text {Subst}\left (\int x^2 \left (1+\frac {b x^n}{a}\right )^p \, dx,x,c \tan (e+f x)\right )}{c^3 f}+\frac {\left (\left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}\right ) \text {Subst}\left (\int \left (1+\frac {b x^n}{a}\right )^p \, dx,x,c \tan (e+f x)\right )}{c f} \\ & = \frac {\operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b (c \tan (e+f x))^n}{a}\right ) \tan (e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}}{f}+\frac {\operatorname {Hypergeometric2F1}\left (\frac {3}{n},-p,\frac {3+n}{n},-\frac {b (c \tan (e+f x))^n}{a}\right ) \tan ^3(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.14 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.76 \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\frac {\tan (e+f x) \left (3 \operatorname {Hypergeometric2F1}\left (\frac {1}{n},-p,1+\frac {1}{n},-\frac {b (c \tan (e+f x))^n}{a}\right )+\operatorname {Hypergeometric2F1}\left (\frac {3}{n},-p,\frac {3+n}{n},-\frac {b (c \tan (e+f x))^n}{a}\right ) \tan ^2(e+f x)\right ) \left (a+b (c \tan (e+f x))^n\right )^p \left (1+\frac {b (c \tan (e+f x))^n}{a}\right )^{-p}}{3 f} \]

[In]

Integrate[Sec[e + f*x]^4*(a + b*(c*Tan[e + f*x])^n)^p,x]

[Out]

(Tan[e + f*x]*(3*Hypergeometric2F1[n^(-1), -p, 1 + n^(-1), -((b*(c*Tan[e + f*x])^n)/a)] + Hypergeometric2F1[3/
n, -p, (3 + n)/n, -((b*(c*Tan[e + f*x])^n)/a)]*Tan[e + f*x]^2)*(a + b*(c*Tan[e + f*x])^n)^p)/(3*f*(1 + (b*(c*T
an[e + f*x])^n)/a)^p)

Maple [F]

\[\int \sec \left (f x +e \right )^{4} \left (a +b \left (c \tan \left (f x +e \right )\right )^{n}\right )^{p}d x\]

[In]

int(sec(f*x+e)^4*(a+b*(c*tan(f*x+e))^n)^p,x)

[Out]

int(sec(f*x+e)^4*(a+b*(c*tan(f*x+e))^n)^p,x)

Fricas [F]

\[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\int { {\left (\left (c \tan \left (f x + e\right )\right )^{n} b + a\right )}^{p} \sec \left (f x + e\right )^{4} \,d x } \]

[In]

integrate(sec(f*x+e)^4*(a+b*(c*tan(f*x+e))^n)^p,x, algorithm="fricas")

[Out]

integral(((c*tan(f*x + e))^n*b + a)^p*sec(f*x + e)^4, x)

Sympy [F(-1)]

Timed out. \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\text {Timed out} \]

[In]

integrate(sec(f*x+e)**4*(a+b*(c*tan(f*x+e))**n)**p,x)

[Out]

Timed out

Maxima [F]

\[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\int { {\left (\left (c \tan \left (f x + e\right )\right )^{n} b + a\right )}^{p} \sec \left (f x + e\right )^{4} \,d x } \]

[In]

integrate(sec(f*x+e)^4*(a+b*(c*tan(f*x+e))^n)^p,x, algorithm="maxima")

[Out]

integrate(((c*tan(f*x + e))^n*b + a)^p*sec(f*x + e)^4, x)

Giac [F(-2)]

Exception generated. \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\text {Exception raised: TypeError} \]

[In]

integrate(sec(f*x+e)^4*(a+b*(c*tan(f*x+e))^n)^p,x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Unable to divide, perhaps due to rounding error%%%{1,[0,1,2,0,0]%%%}+%%%{1,[0,1,0,2,0]%%%} / %%%{1,[0,0,3,0
,1]%%%} Err

Mupad [F(-1)]

Timed out. \[ \int \sec ^4(e+f x) \left (a+b (c \tan (e+f x))^n\right )^p \, dx=\int \frac {{\left (a+b\,{\left (c\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\right )}^p}{{\cos \left (e+f\,x\right )}^4} \,d x \]

[In]

int((a + b*(c*tan(e + f*x))^n)^p/cos(e + f*x)^4,x)

[Out]

int((a + b*(c*tan(e + f*x))^n)^p/cos(e + f*x)^4, x)